Name
The Name is a descriptive identifier for a field that can be up to 63 characters by default (letters or numbers) including spaces. The names should be descriptive enough that anyone can easily identify them when viewing or editing records. For example, LastName, FirstName, StreetAddress, or HomePhone.
Use the Name edit box to set the field name. Note that the name of the field must be unique among all the field names in the table.
Type
After you name a field, you choose a data type for the data to be contained in the field. When you choose a field's data type, you are deciding:
- What kind of values to allow in the field. You cannot store text in field with the Numeric data type.
- How much storage space PostgreSQL is to set aside for the data in that field.
- What types of operations can be performed on the values in that field.
The Type dropdown list defines the type of the field data.
Note: Some built-in general-purpose data types are not applicable for PostgreSQL 8.2 or earlier versions.
Name | Aliases | Description |
bigint | int8 | signed eight-byte integer |
bigserial | serial8 | autoincrementing eight-byte integer |
bit [ (n) ] | fixed-length bit string | |
bit varying [ (n) ] | varbit | variable-length bit string |
boolean | bool | logical Boolean (true/false) |
box | rectangular box in the plane | |
bytea | binary data ("byte array") | |
character varying [ (n) ] | varchar [ (n) ] | variable-length character string |
character [ (n) ] | char [ (n) ] | fixed-length character string |
cidr | IPv4 or IPv6 network address | |
circle | circle in the plane | |
date | calendar date (year, month, day) | |
double precision | float8 | double precision floating-point number |
inet | IPv4 or IPv6 host address | |
integer | int, int4 | signed four-byte integer |
interval [ (p) ] | time span | |
line | infinite line in the plane | |
lseg | line segment in the plane | |
macaddr | MAC address | |
money | currency amount | |
numeric [ (p, s) ] | decimal [ (p, s) ] | exact numeric of selectable precision |
path | geometric path in the plane | |
point | geometric point in the plane | |
polygon | closed geometric path in the plane | |
real | float4 | single precision floating-point number |
smallint | int2 | signed two-byte integer |
serial | serial4 | autoincrementing four-byte integer |
text | variable-length character string | |
time [ (p) ] [ without time zone ] | time of day | |
time [ (p) ] with time zone | timetz | time of day, including time zone |
timestamp [ (p) ] [ without time zone ] | date and time | |
timestamp [ (p) ] with time zone | timestamptz | date and time, including time zone |
tsquery | text search query | |
tsvector | text search document | |
txid_snapshot | user-level transaction ID snapshot | |
uuid | universally unique identifier | |
xml | XML data |
Length
Define the length of the field.
Decimals
Define the number of digits after the decimal
point (the scale) for Floating Point data type.
Dimension
Define column as variable-length multidimensional arrays.
Note: Be careful when shortening the field length as losing data might be caused.
Allow Null
Allow the NULL values for the field.
Note: To set NULL as default value, see Setting Other Field Properties.
Key
A Primary Key is a single field or combination of fields that uniquely defines a record. None of the fields that are part of the primary key can contain a null value.